package com.mapfinal.server.layer;

import com.mapfinal.map.Layer;
import com.mapfinal.map.layer.FeatureLayer;
import com.mapfinal.resource.FeatureResource;
import com.mapfinal.server.layer.model.MfLayer;
import com.mapfinal.server.layer.model.MfStyle;

public class ServerFeatureLayer extends FeatureLayer implements ServerLayer {
	/**
	 * 数据源
	 */
	private MfLayer mfLayer;
	private MfStyle mfStyle;

	public ServerFeatureLayer(MfLayer mfLayer, FeatureResource resource) {
		super(resource);
		this.mfLayer = mfLayer;
	}

	@Override
	public String getType() {
		// TODO Auto-generated method stub
		int type = mfLayer.getLayertype();
		switch (type) {
		case 0:
			return ServerLayerType.vector.name();
		case 1:
			return ServerLayerType.raster.name();
		case 2:
			return ServerLayerType.online_tile.name();
		case 3:
			return ServerLayerType.offline_tile.name();
		}
		return null;
	}

	@Override
	public Layer getLayer() {
		// TODO Auto-generated method stub
		return this;
	}

	@Override
	public ServerDataStore getServerDataStore() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public MfLayer getMfLayer() {
		// TODO Auto-generated method stub
		return mfLayer;
	}

	public void setMfLayer(MfLayer mfLayer) {
		this.mfLayer = mfLayer;
	}

	public MfStyle getMfStyle() {
		return mfStyle;
	}

	public void setMfStyle(MfStyle mfStyle) {
		this.mfStyle = mfStyle;
	}
}
